<template>
	<el-row>
		<el-col :span="24">
			<div class="box">
				<div class="box-header">
					 <el-col :span="8">
		            <h3 class="box-title" style="line-height: 40px;">
		              通知公告
		            </h3>
		          </el-col>
				</div>
				<div class="box-body">
					<el-row>
						<el-col :span="24">
							<div class="title">
								<h2>{{this.file.title}}</h2>
							</div>
							<div style="text-align:center;margin-bottom:5px;">
								<font size="2" face="宋体" color="#8E8E8E" text-align="center">
					              <strong>发布时间：{{this.file.update_time}}</strong>
					            </font>
							</div>
							<div style="text-align:center;width:80%;margin-left:10%;">
								<p style="text-align: left;" v-html="file.text"></p>
								<div class="filedown">
									<p style="text-align: left;padding-left: 10px;">附件:</p>
									<el-table
							          :data="filedown"
							          style="width: 100%;border:0;"
							          :show-header="false"
							          center>
							           <el-table-column
							            prop="file_name"
							            width="600">
							           <template slot-scope="scope">
							                <a :href="'http://' + scope.row.url" target="_blank" style="color:black;">{{scope.row.name}}</a>
							            </template>
							          </el-table-column>
							         </el-table>
								</div>
							</div>
							
						</el-col>
					</el-row>
				</div>
			</div>
		</el-col>
	</el-row>
</template>

<script type="text/javascript">
import http from '../assets/js/http'

export default {
  data() {
    return {
      seeAdd:false,
      operating3:false,
      file:{},
      id: '',
      filedown: []
    }
  },
  methods: {
  	getData() {
  		let data = {
  			id: Number(this.$route.params.id)
  		}
  		console.log(data)
  		this.apiPost("admin/Train/Homepagelist",data).then(res => {
        this.handelResponse(res, data => {
          this.file = res.data
          this.filedown = res.data.file
          console.log(this.file)        
      	})
      })
  	},
  	ToText(HTML)
    {
      var input = HTML;
      return input.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi,'').replace(/<[^>]+?>/g,'').replace(/\s+/g,' ').replace(/ /g,' ').replace(/>/g,' ');  
    }
  },
  created() {
  	_g.closeGlobalLoading()
  	this.getData()
  },
  computed: {},
  mixins: [http]
}
 
</script>
<style>
.box {
  position: relative;
  border-radius: 3px;
  background: #fff;
  border-top: 3px solid #d2d6de;
  margin-bottom: 20px;
  width: 100%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  border-top-color: #3c8dbc;
}
.box-body {
  min-width:70%;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  padding: 10px;
  min-height: 0.01%;
  overflow-x: auto;
  top: 50%;
  left: 50%;
}
.box-header {
  height: 34px;
  line-height: 34px;
  color: #444;
  display: block;
  padding: 10px;
  position: relative;
}
.title {
	width:80%;
	border-bottom: 1px solid #F0EDE4;
	border-top: 1px solid #F0EDE4;
	text-align: center;
}
.filedown {
	width:80%;
	text-align:center;
	margin-left: 29%;
}
</style>